<template>
  <div class="info-wrapper">
    <HeaderBar />

    <div class="info-content">
      <div class="left-wrapper">
        <div class="main-title" @click="$router.push('/info')">
          行业资讯
        </div>
        <a-menu
          style="width: 256px"
          :default-selected-keys="['1']"
          :open-keys.sync="openKeys"
          mode="inline"
        >
          <a-sub-menu v-for="item in list" :key="item.key" :title="item.title">
            <a-menu-item
              v-for="inner in item.children"
              :key="inner.key"
              @click="handleClick(inner)"
            >
              {{ inner.title }}
            </a-menu-item>
          </a-sub-menu>
        </a-menu>
      </div>

      <div class="right-wrapper">
        <router-view :list="list" />
      </div>
    </div>
  </div>
</template>
<script>
import HeaderBar from "@/components/headerBar/HeaderBar";
export default {
  components: {
    HeaderBar
  },
  data() {
    return {
      current: [],
      openKeys: [],
      list: [
        {
          title: "政策法规",
          key: "a",
          children: [
            {
              title: "关于厦门市市级财政投融资建设项目代建制管理办法的政策解读",
              key: "关于厦门市市级财政投融资建设项目代建制管理办法的政策解读",
              date: "2021-06-23"
            },
            {
              title:
                "厦门市建设局关于房屋建筑和市政基础设施工程农民工工资垫付及清偿责任制度的政策解读",
              key:
                "厦门市建设局关于房屋建筑和市政基础设施工程农民工工资垫付及清偿责任制度的政策解读",
              date: "2021-06-23"
            }
          ]
        },
        {
          title: "行业动态",
          key: "b",
          children: [
            {
              title:
                "我会携手北京集美家居建材商场举行首批“重质量.守诚信”商户授牌仪式",
              key:
                "我会携手北京集美家居建材商场举行首批“重质量.守诚信”商户授牌仪式",
              date: "2021-06-23"
            },
            {
              title: "祝贺厦门市思明区建筑行业协会成立",
              key: "祝贺厦门市思明区建筑行业协会成立",
              date: "2021-06-23"
            }
          ]
        },
        {
          title: "通知公告",
          key: "c",
          children: [
            {
              title:
                "厦门市建设局转发省住建厅办公室关于考核聘任第四届福建省建设工程安全专项施工方案论证专家的通知",
              key:
                "厦门市建设局转发省住建厅办公室关于考核聘任第四届福建省建设工程安全专项施工方案论证专家的通知",
              date: "2021-06-23"
            }
          ]
        },
        {
          title: "项目资讯",
          key: "d",
          children: [
            {
              title: "住房城乡建设部重申：坚持房地产调控目标不动摇、力度不放松",
              key: "住房城乡建设部重申：坚持房地产调控目标不动摇、力度不放松",
              date: "2021-06-23"
            }
          ]
        }
      ]
    };
  },
  watch: {
    openKeys(val) {
      console.log("openKeys", val);
    }
  },
  methods: {
    handleClick(item) {
      this.$router.push("/info/" + item.title);
    }
  }
};
</script>

<style lang="less" scoped>
.info-wrapper {
  .info-content {
    background: @white;
    margin-top: 16px;
    display: flex;

    .left-wrapper {
      width: 256px;
      border-right: 1px solid @border-color;

      .main-title {
        padding: 40px 0;
        font-size: 32px;
        font-weight: bold;
        background: #0090dd;
        color: @white;
        text-align: center;
        cursor: pointer;
        margin: 16px;
        border-radius: 8px;
      }
    }

    .right-wrapper {
      flex: 1;
    }
  }
}
</style>
